package com.pan.enumn;

import com.pan.interfere.Interfere;

import java.util.function.BiFunction;

public enum ComputeEnum {

    ADD_SIGN('+',(a,b)->a+b),
    SUBTRACT_SIGN('-',(a,b)->a-b),
    MULTIPLY_SIGN('*',(a,b)->a*b);
//    DIVIDE_SIGN('/',(a,b)->a/b);

    private char sign;
    private BiFunction<Integer,Integer,Integer> calculate;

    ComputeEnum(char sign, BiFunction<Integer, Integer, Integer> calculate) {
        this.sign = sign;
        this.calculate = calculate;
    }

    public char getSign() {
        return sign;
    }

    public BiFunction<Integer, Integer, Integer> getCalculate() {
        return calculate;
    }
}
